<?php
namespace app\index\controller;
use think\Controller;
use app\index\model\Books;
use app\index\model\Img;
use think\Request;
class Index extends Controller
{
	public function create(){//get
		
	}
	public function save(){//post
		
	}
	public function read($id){//get
		
	}
	public function edit($id){//get
		
	}
	public function update(){//put
		
	}
	public function delete(){//delete
		
	}
	public function miss(){
		echo "路径不存在";
		}
	public function pr($a){
		echo $a;
		
	}
    public function index()//这样写就可以把网页加载的名字变为参数
    {
		// $a=Request::instance();
		// //echo $_SERVER["SERVER_ADDR"];
		// $t=\date_create("2020-05-01");
		// $b=date_format($t,"Y-m-d H:i:s");
		// //date_diff();
		// echo date("Y-m-d H:i:s",strtotime("2020-05-01"));//获取指定时间秒
		// echo time()."</br>";//获取当前秒
		// echo strtotime("2020-05-01");
		// //echo \var_dump(getDate());
		// \header("taken:".'qw');
		// \header("qw:".'qw');
		// echo $b;
		
  //       return '<style type="text/css">*{ padding: 0; margin: 0; } .think_default_text{ padding: 4px 48px;} a{color:#2E5CD5;cursor: pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }</style><div style="padding: 24px 48px;"> <h1>:)</h1><p> ThinkPHP V5<br/><span style="font-size:30px">十年磨一剑 - 为API开发设计的高性能框架</span></p><span style="font-size:22px;">[ V5.0 版本由 <a href="http://www.qiniu.com" target="qiniu">七牛云</a> 独家赞助发布 ]</span></div><script type="text/javascript" src="https://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script><script type="text/javascript" src="https://e.topthink.com/Public/static/client.js"></script><think id="ad_bd568ce7058a1091"></think>';
  //   
 // return $this->fetch();
  }
	public function da(){
		// $req=Request::instance();//请求注入
		// echo $req->isGet();
		// echo 123;
		// $w="我爱w祖e国";
		// $c=mb_substr($w,1,3,'utf-8');
		// echo $c.'$gt';
		$b=new Books();
		foreach($b->page() as $Key){
			echo $Key;
		}
	}
	public function show()
	{
		// $a=new Books();
		// $w=$a->api();
		
		// return json($w);
		$i=new Img();
		$s=$i->index();
		return json($s);
		
	}
	public function lx(){
		session_start();
		$_SESSION['name']='pass';
		echo $_SESSION['name'];
		cache("name","liu");
		$s=Request::instance()->header();
		echo var_dump($s);
		cookie("name","liuyongasa");
		session("name","liuyong");
		cookie('name',null);
		echo session("name");
		
		
		
	}
	
}
//123{$user}
		//<ul>
			//{volist name="d" id="a"}
			//<li>{$a.name}</li>
			//{/volist}
		//</ul>
		//{$d->render()}